package service;

import dao.UserDao;
import dao.impl.UserDaoImpl;
import pojo.User;

import java.util.List;

public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDaoImpl();

    @Override
    public int registerUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public User loginUser(String username, String password) {
        return userDao.getUserByUsernameAndPassword(username, password);
    }

    @Override
    public List<User> getAllUsers() {
        return userDao.getAllUsers();
    }
}